//https://leetcode.cn/problems/di-yi-ge-zhi-chu-xian-yi-ci-de-zi-fu-lcof/
class Solution {
public:
    char firstUniqChar(string s) {
        if (!s.empty())
        {
            vector<int> arr;
            arr.resize(26, 0);

            for (auto c : s)
            {
                ++arr[c - 'a'];
            }

            for (auto c : s)
            {
                if (arr[c - 'a'] == 1)
                {
                    return c;
                }
            }
        }

        return ' ';
    }
};